<template>
	<view style="padding-bottom: 102rpx;">
		<view class="shangdian" v-for="(item, index) in details" :key="index" @click="chengping(item)">
			<p @click="tiao_gongshi">{{ item.title }}</p>
			<view class="shangdian_a">
				<view class="tit_a">
					<view class="tit_a_a">{{ item.type }}</view>
					<view class="tit_a_b">会员{{ item.num_day }}</view>
				</view>
				<view class="tit_b">
					<u-icon name="map"></u-icon>
					<span>{{ item.site }}</span>
				</view>
			</view>
			<view class="xian_qing">
				<image :src="item.cover" mode="aspectFill" @click.stop="preview(item.cover)"></image>
				<view class="xiangqing">
					<p class="xiangqing_name">{{ item.name }}</p>
					<span>￥{{ item.price }}/天</span>
					<span class="yuan_jia">￥{{ item.lineation }}/天</span>
					<p class="be_zhu">{{ item.brief }}</p>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {};
	},
	props: {
		details: {
			type: Object,
			default: null,
		},
	},
	methods: {
		preview(urls) {
			uni.previewImage({
				urls: [urls],
				longPressActions: {
					itemList: ['发送给朋友', '保存图片', '收藏'],
					success: function(data) {
						console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
					},
					fail: function(err) {
						console.log(err.errMsg);
					},
				},
			});
		},
		tiao_gongshi() {
			// wx.navigateTo({
			// 	url: './Home/gonsi_Home',
			// });
		},
		chengping(i) {
			wx.navigateTo({
				url: './Home/changping?id=' + i.id + '&dj_id=' + i.dj_id,
			});
		},
	},
};
</script>

<style lang="scss" scoped>
.shangdian {
	width: 690rpx;
	margin: auto;

	background-color: #ffffff;
	border-radius: 10rpx;
	margin-bottom: 25rpx;
	padding-bottom: 20rpx;
	box-shadow: 0px 0px 6px 0px rgba(13, 21, 28, 0.1);
	p {
		width: 650rpx;
		height: 65rpx;
		line-height: 80rpx;
		font-size: 30rpx;
		color: #333333;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		margin-left: 20rpx;
	}
	.shangdian_a {
		width: 650rpx;
		height: 60rpx;
		margin-left: 20rpx;
		display: flex;
		justify-content: space-between;
		.tit_a {
			width: 250rpx;
			height: 40rpx;
			display: flex;
			justify-content: space-between;
			.tit_a_a {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 100rpx;
				height: 35rpx;
				border: 2rpx solid #ff0000;
				color: #ff0000;
				font-size: 20rpx;
				text-align: center;

				border-radius: 4px;
				margin-top: 10rpx;
			}
			.tit_a_b {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 100rpx;
				height: 35rpx;
				border: 2rpx solid #ff0000;
				color: #ff0000;
				font-size: 20rpx;
				text-align: center;

				border-radius: 4px;
				margin-top: 10rpx;
			}
		}
		.tit_b {
			width: 260rpx;
			height: 50rpx;
			display: flex;
			align-items: center;
			margin-top: 10rpx;
			image {
				width: 23rpx;
				height: 26rpx;
				margin-right: 10rpx;
			}
			span {
				margin-left: 15rpx;
				display: block;
				width: 180rpx;
				height: 30rpx;
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #999999;
				line-height: 30rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
		}
	}
	.xian_qing {
		width: 650rpx;
		height: 200rpx;
		margin: auto;
		display: flex;
		justify-content: space-between;
		image {
			width: 200rpx;
			height: 200rpx;
		}
		.xiangqing {
			width: 430rpx;
			height: 200rpx;
			// border: 1rpx solid red;
			.xiangqing_name {
				width: 370rpx;
				height: 40rpx;
				line-height: 40rpx;
				text-overflow: ellipsis;
				white-space: nowrap;
				margin-left: 20rpx;
				margin-bottom: 10rpx;
			}
			span {
				color: #ff0000;
				margin-left: 20rpx;
			}
			.yuan_jia {
				color: #999999;
				font-size: 24rpx;
				text-decoration: underline;
				text-decoration: line-through;
				margin-left: 15rpx;
			}
			.be_zhu {
				width: 370rpx;
				height: 80rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				margin-left: 20rpx;
				font-size: 24rpx;
				color: #999999;
				// border: 1rpx solid red;
			}
		}
	}
}
</style>
